<template>
    <el-dialog 
      :visible="visible" 
      :title="title" 
      :width="width"      
      modal
      center
      :close-on-click-modal="false"
      :show-close="false">  
    <slot></slot>
    <div slot="footer" class="dialog-footer">
      <el-button @click="handleCancel">取消</el-button>
      <el-button type="primary" @click="handleConfirm">确认</el-button>
    </div>
  </el-dialog>
  </template>
  
<script>

export default({
    name: 'MyDialog',
    props: {
      width: String,      
      title: String,
      visible: Boolean
    },
    methods: {
      handleCancel() {
        this.$emit("handleCancel")
      },
      handleConfirm() {
        this.$emit("handleConfirm")
      }
    }
})

</script>

<style scoped>

</style>